
function includes(collection,ch){
  for(let item of collection){
    if(item===ch)
      return true;
  }
  return false;
}
function collect_same_elements(collection_a, collection_b) {
  let result = [];
  for(let item_a of collection_a){
    for(let arrItem_b of collection_b){
      if(includes(arrItem_b,item_a)){
        result.push(item_a);
      }
    }
  }
  return result;
}

module.exports = collect_same_elements;
